<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<?php $this->load->view('common/head');?>

<?php $this->load->view('common/header');?>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <?php $this->load->view('common/sidebar');?>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <?php $this->load->view('common/breadcrumbs');?>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">

                <?php $this->load->view('common/set');?>

						<div class="row">
							<div class="col-xs-12">
								<form accept-charset="UTF-8" id="new_add" action="<?php echo site_url(X_URL.'webset/categoryset');?>" class="form-horizontal" role="form" method="post" novalidate="novalidate">
								<?php echo csrf_hidden();?>	
									<div class="space-4"></div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="web_citye_json"> 地区 </label>

										<div class="col-sm-9">
											<a href="javascript:web_citye_json();" id="web_citye_json" class="btn btn-sm btn-info">生成</a>
											<?php if(!file_exists(FCPATH.'app/config/cityjson.php')){echo '<span class="cityinfo red">未生成</span>';}else{echo '<span class="cityinfo green">已生成</span>';}?>
											<span class="help-block col-sm-reset inline col-xs-12 col-sm-7 hidden-480">站内地区的JSON文件</span>
										</div>
									</div>									
									<div class="space-4"></div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="web_category_txt"> 站内频道 </label>

										<div class="col-sm-9">
											<input type="text" id="web_category_txt" name="web_category_txt" placeholder="站内频道" class="col-xs-10 col-sm-5" value="<?php echo $this->config->item('web_category_txt');?>">
											<span class="help-block col-sm-reset inline col-xs-12 col-sm-7 hidden-480">设置时用|分开，不设置则不启用</span>
										</div>
									</div>
									<div class="space-4"></div>
									<div class="form-group">
										<label class="col-sm-3 control-label no-padding-right" for="web_category"> 频道属性 </label>

										<div class="col-sm-9">
											<input type="text" id="web_category" name="web_category" placeholder="频道属性" class="col-xs-10 col-sm-5" value="<?php echo $this->config->item('web_category');?>">
											<span class="help-block col-sm-reset inline col-xs-12 col-sm-7 hidden-480">数字，与上面对应哦</span>
										</div>
									</div>									
									<div class="clearfix form-actions">
										<div class="col-md-offset-3 col-md-9">
											<button class="btn btn-info" type="submit">
												<i class="ace-icon fa fa-check bigger-110"></i>
												确认更新
											</button>
										</div>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>					
			</div><!-- /.main-content -->

			<?php $this->load->view('common/footer');?>

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->
		<?php $this->load->view('common/footerjs');?>
		<script type="text/javascript">
			function web_citye_json(){
				$.get("<?php echo site_url(X_URL.'webset/city_json');?>", function(result){
					if(result==1){
						$(".cityinfo").html('已生成');
					}else{
						$(".cityinfo").html('未知错误');
					}			    
				});
			}
		</script>
		<!-- inline scripts related to this page -->
		</body>
		</html>
